import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/same_time_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/project_same_time_entity.dart';


SameTimeEntity $SameTimeEntityFromJson(Map<String, dynamic> json) {
  final SameTimeEntity sameTimeEntity = SameTimeEntity();
  final ProjectSameTimeEntity? cancel = jsonConvert.convert<ProjectSameTimeEntity>(json['cancel']);
  if (cancel != null) {
    sameTimeEntity.cancel = cancel;
  }
  final ProjectSameTimeEntity? construction = jsonConvert.convert<ProjectSameTimeEntity>(json['construction']);
  if (construction != null) {
    sameTimeEntity.construction = construction;
  }
  final ProjectSameTimeEntity? design = jsonConvert.convert<ProjectSameTimeEntity>(json['design']);
  if (design != null) {
    sameTimeEntity.design = design;
  }
  final String? end = jsonConvert.convert<String>(json['end']);
  if (end != null) {
    sameTimeEntity.end = end;
  }
  final String? projectName = jsonConvert.convert<String>(json['projectName']);
  if (projectName != null) {
    sameTimeEntity.projectName = projectName;
  }
  final String? projectTypeName = jsonConvert.convert<String>(json['projectTypeName']);
  if (projectTypeName != null) {
    sameTimeEntity.projectTypeName = projectTypeName;
  }
  final String? start = jsonConvert.convert<String>(json['start']);
  if (start != null) {
    sameTimeEntity.start = start;
  }
  final String? nowStatus = jsonConvert.convert<String>(json['nowStatus']);
  if (nowStatus != null) {
    sameTimeEntity.nowStatus = nowStatus;
  }
  final ProjectSameTimeEntity? trialProduction = jsonConvert.convert<ProjectSameTimeEntity>(json['trialProduction']);
  if (trialProduction != null) {
    sameTimeEntity.trialProduction = trialProduction;
  }
  return sameTimeEntity;
}

Map<String, dynamic> $SameTimeEntityToJson(SameTimeEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['cancel'] = entity.cancel.toJson();
  data['construction'] = entity.construction.toJson();
  data['design'] = entity.design.toJson();
  data['end'] = entity.end;
  data['projectName'] = entity.projectName;
  data['projectTypeName'] = entity.projectTypeName;
  data['start'] = entity.start;
  data['nowStatus'] = entity.nowStatus;
  data['trialProduction'] = entity.trialProduction.toJson();
  return data;
}

extension SameTimeEntityExtension on SameTimeEntity {
  SameTimeEntity copyWith({
    ProjectSameTimeEntity? cancel,
    ProjectSameTimeEntity? construction,
    ProjectSameTimeEntity? design,
    String? end,
    String? projectName,
    String? projectTypeName,
    String? start,
    String? nowStatus,
    ProjectSameTimeEntity? trialProduction,
  }) {
    return SameTimeEntity()
      ..cancel = cancel ?? this.cancel
      ..construction = construction ?? this.construction
      ..design = design ?? this.design
      ..end = end ?? this.end
      ..projectName = projectName ?? this.projectName
      ..projectTypeName = projectTypeName ?? this.projectTypeName
      ..start = start ?? this.start
      ..nowStatus = nowStatus ?? this.nowStatus
      ..trialProduction = trialProduction ?? this.trialProduction;
  }
}
